package com.xzj.common.id.gen;

import com.xzj.common.id.domain.IdGeneratorOptions;
import com.xzj.common.id.exception.IdGeneratorException;

/**
 * @program: xzj-common
 * @ClassName: DefaultIdHelper
 * @description: 默认执行器
 * @author: XiaZunJun
 * @create: 2024-08-05 15:19
 */
public class DefaultIdHelper{

    public static long nextId() throws IdGeneratorException {
        if(null == IdHelper.getIdGenInstance()){
            IdHelper.setIdGenerator(new IdGeneratorOptions());
        }
        return IdHelper.nextId();
    }

    public static String nextIdStr() throws IdGeneratorException {
        return String.valueOf(nextId());
    }

}
